package service.imp;

import Dao.imp.ProductDao;
import entity.Product;
import mapper.ProductMapper;
import service.IProductService;

import java.util.List;

/**
 * @author Jiuyuesheng
 * @date 2019/12/30  15:48
 */
public class ProductService implements IProductService {
    private ProductMapper productDao = new ProductDao();
    @Override
    public List<Product> queryAllProduct() {
        List<Product> products = productDao.queryAllProduct();
        return products;
    }

    @Override
    public List<Product> queryAllProductByName(String name) {
        List<Product> products = productDao.queryProductByPname(name);
        return products;
    }

    @Override
    public Product queryProductByPid(int pid) {
        Product product = productDao.queryProduct(pid);
        return product;
    }
}
